package com.chen.service.serviceimpl;

import com.chen.dao.DormDao;
import com.chen.pojo.Building;
import com.chen.pojo.Dorm;
import com.chen.service.DormService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DormServiceImpl implements DormService {
    @Autowired
    DormDao dormDao;

    @Override
    public List<Dorm> getDormList(Dorm dorm) {
        return dormDao.getDormList(dorm);
    }

    @Override
    public void deleteDormById(int id) {
        dormDao.deleteDormById(id);
    }

    @Override
    public Dorm getIsDorm(Dorm dorm) {
        return dormDao.getIsDorm(dorm);
    }

    @Override
    public void addDorm(Dorm dorm) {
        dormDao.addDorm(dorm);
    }

    @Override
    public List<Dorm> getDormListByAjax(Building building) {
        return dormDao.getDormListByAjax(building);
    }

    @Override
    public Dorm getDormById(int id) {
        return dormDao.getDormById(id);
    }

    @Override
    public void updateDormLiveNum(Dorm dorm) {
        dormDao.updateDormLiveNum(dorm);
    }
}
